.section .data
arr1:
    .word 1
    .word 2
    .word 3
    .word 4
    .word 5
arr2:
    .word 6
    .word 7
    .word 8
    .word 9
    .word 10
result:
    .space 20

.section .text
.globl _start

vector_add_func:
    addi sp, sp, -8
    sw ra, 4(sp)
    sw s0, 0(sp)
    addi s0, sp, 8
    # 函数参数: a0=dst, a1=src1, a2=src2, a3=length
    li x5, 0
loop_start_1:
    slli x6, x5, 2
    add x29, a1, x6
    lw x7, 0(x29)
    add x29, a2, x6
    lw x28, 0(x29)
    add x7, x7, x28
    add x29, a0, x6
    sw x7, 0(x29)
    addi x5, x5, 1
    blt x5, a3, loop_start_1
loop_end_2:
    lw ra, 4(sp)
    lw s0, 0(sp)
    addi sp, sp, 8
    ret
_start:
    # 调用向量加法函数
    la a0, result
    la a1, arr1
    la a2, arr2
    li a3, 5
    jal ra, vector_add_func
    li a0, 0
    li a7, 93
    ecall